# Contributor: Henrik Riomar <henrik.riomar@gmail.com>
# Maintainer: Henrik Riomar <henrik.riomar@gmail.com>
pkgname=apt-dater-host
pkgver=1.0.1
pkgrel=2
pkgdesc="Host helper application for apt-dater"
url="https://github.com/DE-IBH/apt-dater-host"
arch="noarch"
license="GPL-2.0-or-later"
checkdepends="bats checkbashisms"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/DE-IBH/$pkgname/archive/v$pkgver.tar.gz
	apt-dater-host-fix-bashisms.patch
	apk-improve-Machine-Type-reporting.patch
	apk-switch-to-doas-from-sudo.patch
	apk-handle-FORBID_-lines.patch
	apk-add-CLUSTERS-support.patch
	"

check() {
	cd "$builddir"/apk
	make check

	checkbashisms ./apt-dater-host
}

package() {
	cd "$builddir"/apk
	make install DESTDIR="$pkgdir"

	cd "$builddir"/man
	install -d -m0755 "$pkgdir"/usr/share/man/man1
	install -m0644 "$pkgname".1 "$pkgdir"/usr/share/man/man1
}
sha512sums="
52d48ade6758cb1150be2f21ed4c9831b4254ccc749ae865321abea077737a49ff7aeefb4e643aa289d953d2847dcf83e94837fe510fa8f8bfe19cfda0fd9dbc  apt-dater-host-1.0.1.tar.gz
6f695e1b1785f88217b5a32c509b5cb3c7a3f70069b042ad9770a4c1e86c4477abab2763579130f65e0c880976eb9f292bed3b42dda0d25e801696db479e55e8  apt-dater-host-fix-bashisms.patch
f56c38f9f8af119517965da8fe65a8d55f1e489ae8b3402cb72c55a7b876a658ee6dd7042342922fac3e5e59e872555914ca8e2f8dd723e98566ce6b16c341ce  apk-improve-Machine-Type-reporting.patch
8437e8b2dc655a3e15200bc9399ab275c299ec199aa90330ca826265abbb4f778227c68039ffca07123cbd392287ab53e70d020c5625ecefed93ab6a97b4edd6  apk-switch-to-doas-from-sudo.patch
08e43644dc4c15904f4a4e100ffaf1efc551106404042f168e6bd7bb88e939f6de06cd1b7fc3e748e82333a6700ec208f14b03f3926bcc83253893e70c9b86d8  apk-handle-FORBID_-lines.patch
405e1bf24a53e5128be7f7457a58597a8ecafe6536c5ba43f871e9773d1e0d47f4855176fd848bd79277876608cd65f73938a0bd339a9f6e3b47c9d629fe311d  apk-add-CLUSTERS-support.patch
"
